import http from "../request";
const apibase = "/api/JobGroupType";

//获取工作集类型
var getJobGroupTypeDtos = function (data) {
  return new Promise((resolve, reject) => {
    http
      .post(apibase + `/GetJobGroupTypes`, data)
      .then((res) => {
        resolve(res);
      })
      .catch((error) => {
        reject(error);
      });
  });
};


//获取工作集类型列表
var getJobGroupTypeDtosList = function (data) {
  return new Promise((resolve, reject) => {
    http
      .post(apibase + `/GetJobGroupTypesList`, data)
      .then((res) => {
        resolve(res);
      })
      .catch((error) => {
        reject(error);
      });
  });
};

//删除工作集类型
var deleteJobGroupTypeDto = function (data) {
  return new Promise((resolve, reject) => {
    http
      .post(apibase + `/DeleteJobGroupType`, data)
      .then((res) => {
        resolve(res);
      })
      .catch((error) => {
        reject(error);
      });
  });
};

//新增工作集类型
var addJobGroupTypeDto = function (data) {
  return new Promise((resolve, reject) => {
    http
      .post(apibase + `/AddJobGroupType`, data)
      .then((res) => {
        resolve(res);
      })
      .catch((error) => {
        reject(error);
      });
  });
};

//修改工作集类型
var updateJobGroupTypeDto = function (data) {
  return new Promise((resolve, reject) => {
    http
      .post(apibase + `/UpdateJobGroupType`, data)
      .then((res) => {
        resolve(res);
      })
      .catch((error) => {
        reject(error);
      });
  });
};

export {
  getJobGroupTypeDtos,
  deleteJobGroupTypeDto,
  updateJobGroupTypeDto,
  addJobGroupTypeDto,
  getJobGroupTypeDtosList
};
